<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<script type="text/javascript">
        window.onload = function(){
        	var oUl = document.getElementById('ul1');
        	var aLi = oUl.getElementsByTagName('li');

        	for(var i=0;i<aLi.length;i++){
        		if(aLi[i].className == 'box'){
        			aLi[i].style.background = 'blue';
        		}
        	}
        }

	</script>
</head>
<body>
	
	<div>
		<ul id="ul1">
			<li class="box">1</li>
			<li>2</li>
			<li  class="box">3</li>
			<li>4</li>
			<li  class="box">5</li>
		</ul>
	</div>
</body>
</html>